//********************************************************************************************************************//
//ORGANIZATION:
//AUTHOR: bpeng(bogers.peng@gmail.com)
//SUMMARY:
//********************************************************************************************************************//
#ifndef NATIVE_SYSTEM_BASE_ITERATE_H
#define NATIVE_SYSTEM_BASE_ITERATE_H

#ifndef NATIVE_SYSTEM_BASE_ATOM_H
#include "System/Base/Atom.h"
#endif

namespace Native { namespace System
{
    //****************************************************************************************************************//
    //IIterate
    //
    //****************************************************************************************************************//
    template<typename _TElement>
    struct NATIVE_LIBRARY_EXPORT IIterate
    {
        virtual _TElement* First() = 0;
        virtual _TElement* Next() = 0;
        virtual _TElement* Current() = 0;
        virtual bool Done() const = 0;
    };

#define NATIVE_FOREACH(ITERATOR, EACH) \
    for (auto EACH = (ITERATOR)->First(); EACH != nullptr; EACH = (ITERATOR)->Next())
}}

#endif